﻿@model yq.WebModel.InitializeAdmin
@Url.Css("Css/metro/css/Index.css")
@Url.Script("Scripts/metro/index.js")
<script>

    $(function () { $.alert("当前系统没有管理员，请先创建管理员"); });

    function InitializeTips(obj)
    {
        if (obj.Status == 1)
        {
            window.location = '@(Url.Action("Index"))';

        } else
        {
            $.tips(obj.ErrorText);
        }

    }
    function onRePassWord()
    {
        if ($("#RePassWord").val() + "a" == "a" || $("#RePassWord").val() != $("#Login_PassWord").val())
        {
             $.inputError("RePassWord","请确认密码");
              return false;
        } else
        {
            $.inputYes("RePassWord");
            return true;
        }
    }
     
  
</script>
<div>
    @using (Ajax.BeginForm("DoInitialize", new { }, new AjaxOptions { HttpMethod = "post", OnSuccess = "InitializeTips" }))
    {

        <ul class="thumbnails">
            <li class="span3" style="float: left; padding-left: 30%;">
                <div class="divlistFormList" style="width: 400px; top: 3%; position: absolute;">
                     <h3>管理员设置</h3>
                    @Html.LabelFor(obj => obj.Account.NickName, "昵称")@Html.TextBoxFor(obj => obj.Account.NickName)
                    @Html.LabelFor(obj => obj.Login.Account, "账号")@Html.TextBoxFor(obj => obj.Login.Account)
                    @Html.LabelFor(obj => obj.Login.PassWord, "密码")@Html.PasswordFor(obj => obj.Login.PassWord, new { onchange = "onRePassWord()" })
                    @Html.LabelFor(obj => obj.Login.PassWord, "确认密码")@Html.Password("RePassWord", null, new { onchange = "onRePassWord()" })
                    <div class="caption" >
                        <p>@Html.Submit("注 册", new { onclick = "return onRePassWord()" })</p>
                    </div>
                </div>
            </li>
        </ul>

    }
</div>
